home *** CD-ROM | disk | FTP | other *** search
/ Aminet 51 / Aminet 51 (2002)(GTI - Schatztruhe)[!][Oct 2002].iso / Aminet / util / misc / NotifyWait.lha / NotifyWait / src / NotifyWait.asm next >
Encoding:
Assembly Source File  |  2002-08-30  |  1.8 KB  |  123 lines

  1.  
  2.  
  3.  
  4.     incbin    start-4000.bin
  5.  
  6. Waiter:
  7.     lea.l    __(pc),a4
  8.     move.l    4.w,a6
  9.     move.l    a6,ExecBase-__(a4)
  10.     jsr    -666(a6)            ;CreateMsgPort
  11.  
  12.     move.l    d0,MagicPort-__(a4)
  13.     beq.w    .noPort
  14.  
  15.     moveq    #37,d0
  16.     lea.l    DosName(pc),a1
  17.     jsr    -552(a6)            ;OpenLibrary
  18.     move.l    d0,DosBase-__(a4)
  19.     beq.w    .noDos
  20.  
  21.     pea.l    Template-__(a4)
  22.     move.l    (sp)+,d1
  23.     pea.l    Array-__(a4)
  24.     move.l    (sp)+,d2
  25.     moveq    #0,d3
  26.     move.l    DosBase-__(a4),a6
  27.     jsr    -798(a6)            ;ReadArgs
  28.     move.l    d0,Args-__(a4)
  29.     bne.b    .B
  30.     bsr.w    PrintFault
  31.     bra.b    .noArgs
  32. .B:
  33.     move.l    0+Array-__(a4),d1
  34.     moveq    #-2,d2                ;READ
  35.     jsr    -84(a6)                ;Lock
  36.     move.l    d0,d1
  37.     bne.b    .A
  38.     bsr.b    PrintFault
  39.     bra.b    .noPath
  40. .A:    jsr    -90(a6)                ;UnLock
  41.  
  42.  
  43.     lea.l    NotifyStr-__(a4),a0
  44.     move.l    0+Array-__(a4),(a0)
  45.     addq.l    #1,12(a0)
  46.     move.l    MagicPort-__(a4),16(a0)
  47.     move.l    a0,d1
  48.     jsr    -888(a6)            ;StartNotify
  49.     tst.l    d0
  50.     bne.b    .loop
  51.  
  52.     moveq    #236/2,d1            ;ERROR_NOT_IMPLEMENTED
  53.     add.l    d1,d1
  54.     bsr    PrintFaultB
  55.     bra.b    .bye
  56.  
  57. .loop:
  58.     moveq    #-1,d0
  59.     move.l    ExecBase-__(a4),a6
  60.     jsr    -318(a6)            ;Wait
  61.  
  62.     btst    #12,d0
  63.     bne.b    .bye
  64.  
  65.     move.l    MagicPort-__(a4),a0
  66.     jsr    -372(a6)            ;GetMsg
  67.     tst.l    d0
  68.     beq.b    .loop
  69. .bye
  70.  
  71.     pea.l    NotifyStr-__(a4)
  72.     move.l    (sp)+,d1
  73.     move.l    DosBase-__(a4),a6
  74.     jsr    -894(a6)            ;EndNotify
  75.  
  76. .noPath:
  77.     move.l    Args-__(a4),d1
  78.     move.l    DosBase-__(a4),a6
  79.     jsr    -858(a6)            ;FreeArgs
  80. .noArgs:
  81.     move.l    DosBase-__(a4),a1
  82.     move.l    ExecBase-__(a4),a6
  83.     jsr    -414(a6)
  84. .noDos:
  85.     move.l    MagicPort-__(a4),a0
  86.     move.l    ExecBase-__(a4),a6
  87.     jsr    -672(a6)            ;DeleteMsgPort
  88. .noPort:
  89.     moveq    #0,d0
  90.     rts
  91.  
  92. PrintFault:
  93.     jsr    -132(a6)            ;IoErr
  94.     move.l    d0,d1
  95. PrintFaultB:
  96.     moveq    #0,d2
  97.     jmp    -474(a6)            ;PrintFault
  98.  
  99.  
  100.  
  101. DosName:    dc.b    "dos.library",0
  102. TEMPLATE:    dc.b    "PATH/A",0
  103.  
  104.         dc.b    "$VER: NotifyWait 0.4 (01.09.02) by Zbigniew Trzcionkowski",10,0
  105.  
  106.         cnop    0,4
  107. NotifyStr:
  108.         ds.l    1            ;path
  109.         ds.l    1
  110.         ds.l    1
  111.         ds.l    1            ;SENDMESSAGE
  112.         ds.l    1
  113.         ds.l    1*7
  114.  
  115. MagicPort:    ds.l    1
  116. ExecBase:    ds.l    1
  117. DosBase:    ds.l    1
  118. Args:        ds.l    1
  119. Array:        ds.l    1*1
  120.  
  121. __:
  122.  
  123.